{include file="header.htm" /}
<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    {include file="bar.htm" /}
    <!-- 操作说明 -->
    <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;">
        <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">提示</h4>
            <span title="收起提示" id="explanationZoom" style="display: block;"></span>
        </div>
        <ul>
            <li>1. 注册快递100的企业账号，专属注册链接：<a href="https://api.kuaidi100.com/extend/register?code=dab6b07c6c204d3abc5253203630630d" target="_blank">立即注册</a></li>
            <li>2. 注册成功后，进入管理后台->实时查询与订阅推送->概览，复制 授权key、customer 填入保存</li>
        </ul>
    </div>
    <form class="form-horizontal" id="post_form" action="{:weapp_url('Querykd/Querykd/index')}" method="post">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit"><label>是否开启</label></dt>
                <dd class="opt">
                    <label class="curpoin">
                        <input name="openQuerykd" value="1" type="radio" {if condition="1 === intval($row.data.openQuerykd)"} checked="checked" {/if} onclick="onOpenQuerykd(this);">开启
                    </label>
                    &nbsp;
                    <label class="curpoin">
                        <input name="openQuerykd" value="0" type="radio" {if condition="0 === intval($row.data.openQuerykd)"} checked="checked" {/if} onclick="onOpenQuerykd(this);">关闭
                    </label>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="apikey"><em id="apikeyEm">{if condition="1 === intval($row.data.openQuerykd)"}*{/if}</em>授权key</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="apikey" value="{$row.data.apikey|default=''}" id="apikey" class="input-txt">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="customer"><em id="customerEm">{if condition="1 === intval($row.data.openQuerykd)"}*{/if}</em>customer</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="customer" value="{$row.data.customer|default=''}" id="customer" class="input-txt">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <div class="bot">
                <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function onOpenQuerykd(obj) {
        var value = $(obj).val();
        $('#apikeyEm, #customerEm').html('');
        if (1 === parseInt(value)) $('#apikeyEm, #customerEm').html('*');
    }

    // 判断输入框是否为空
    function checkForm() {
        if (1 === parseInt($('input[name=openQuerykd]:checked').val())) {
            if ($('input[name=apikey]').val() == '') {
                showErrorMsg('请填写授权key');
                $('input[name=apikey]').focus();
                return false;
            } else if ($('input[name=customer]').val() == '') {
                showErrorMsg('请填写customer');
                $('input[name=customer]').focus();
                return false;
            }
        }
        layer_loading('正在处理');
        $('#post_form').submit();
    }
</script>
{include file="footer.htm" /}